<script language="javascript">
function fun()
{ var i;
  for(i=1;i<=10;i++)
 {
    var sn = 'c'+i;

    document.getElementById(sn).checked= true;
   // document.getElementById('c2').checked='true';
    
  }
}
function fun1()
{ var i;
  for(i=1;i<=10;i++)
 {
    var sn = 'c'+i;

    document.getElementById(sn).checked=false;
   
    
  }
}

</script>
<?php

$i=1;	

echo form_open(base_url().'admin/songs/deletesong');
 ?>
<table align="center" width="400" id="tableadmin">
	
   <?php if($query->num_rows() > 0)
{?>
<tr>
		<th>
		Song
		</th>
		<th>
		Delete
		</th>
		
	</tr>
<?
foreach ($query->result() as $item):

 ?>

<tr>
		<td><input type="checkbox" id='c<?=$i++;?>' name="removeid[]" value=<?=$item->id?>><?=$item->name?>

</td>
		
<td><a href="<?=base_url()?>admin/songs/deletesong/<?=$item->id?>"
			onclick='return confirm("are you sure want to delete");'><img
			src="<?=base_url();?>assets/imgs/delete.png" border='0' /></a></td>
		</tr>

<?php 
     
      endforeach ;?>
<tr>
	
	
	<tr>
		
		<td align='center' colspan="2"><a  onclick="fun();" href="javascript:void(0)">checkall</a>&nbsp;
		<a  onclick="fun1();" href="javascript:void(0)">uncheckall</a></td>
		
	</tr>
	<tr>
		
		<td align='center' colspan="2">
<? echo form_submit('remove','remove selected');?>  
</td>

	</tr>
	<tr>
	<td colspan =4>
	  <?// echo $this->paginationnew->paginate();?>
	  </td>
	  </tr>
</table>
<? }else { ?>
	
<h2>No Songs to display</h2>	
<? }?>

</form>

